<%@ Page Language="C#" MasterPageFile="~/UI/Masters/Content.master" AutoEventWireup="true" CodeBehind="Add.aspx.cs" Inherits="Stratman.Web.VSTS.UI.Pages.Timesheet.Add" %>

<%@ Import Namespace="devBiz.TeamPlain.Util" %>
<%@ Register TagPrefix="uc1" Src="~/UI/Controls/WorkItems/WorkItemFinder.ascx" TagName="WorkItemFinder" %>

<asp:Content ID="c" ContentPlaceHolderID="c" runat="server">
    <script language="javascript" type="text/javascript">
        var changeQueue = new Array();
        
        function PerformAdd()
        {
            var selectedWorkItems = document.all("selectedWorkItems");
        
            for (var i = 0; i < _ctl00_c_wif_sw1.getSelectedItems().length; i++)
            {
                var workItem = _ctl00_c_wif_sw1.getSelectedItems()[i];
                selectedWorkItems.value += workItem.id + ",";
            }
            
            if (selectedWorkItems.value != "")
            {
                selectedWorkItems.value = selectedWorkItems.value.substring(0, selectedWorkItems.value.length - 1);
                document.all("form2").submit();
            }
        }
    </script>

    <asp:Literal ID="ltlError" runat="server"></asp:Literal>
    
    <%=HtmlUtility.GetHeaderHtml("Add Work Item To Timesheet") %>
        
	<uc1:WorkItemFinder ID="wif" runat="server" />
</asp:Content>

<asp:Content ID="d" ContentPlaceHolderID="d" runat="server">
    <form id="form2" method="post">
        <input type="hidden" id="selectedWorkItems" name="selectedWorkItems" />
    </form>
</asp:Content>
